home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Economics / ZendaDistn / Tools / DataAnalysis.ma next >
Encoding:
Text File  |  1992-07-19  |  4.5 KB  |  66 lines

  1. (*^
  2.  
  3. ::[paletteColors = 128; automaticGrouping; currentKernel; 
  4.     fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e8,  24, "Times"; ;
  5.     fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L1, e6,  18, "Times"; ;
  6.     fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, L1, e6,  14, "Times"; ;
  7.     fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L1, a20,  18, "Times"; ;
  8.     fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L1, a15,  14, "Times"; ;
  9.     fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L1, a12,  12, "Times"; ;
  10.     fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  11.     fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  10, "Times"; ;
  12.     fontset = input, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L1,  12, "Courier"; ;
  13.     fontset = output, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5,  12, "Courier"; ;
  14.     fontset = message, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  15.     fontset = print, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  16.     fontset = info, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L1,  12, "Courier"; ;
  17.     fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakBelow, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L1,  12, "Courier"; ;
  18.     fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, L1,  10, "Times"; ;
  19.     fontset = header, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  20.     fontset = Left Header, nohscroll, cellOutline,  12, "Palatino"; ;
  21.     fontset = footer, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M7, L1,  12;
  22.     fontset = Left Footer, cellOutline, blackBox,  12, "Palatino"; ;
  23.     fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  10, "Times"; ;
  24.     fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  25.     fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12, "Courier"; ;
  26.     fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  27.     fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  28.     fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  29.     fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  30.     fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L1,  12;
  31.     next21StandardFontEncoding; ]
  32. :[font = title; inactive; preserveAspect; startGroup; ]
  33. Analyzing Data from Zenda
  34. :[font = subsection; inactive; preserveAspect; startGroup; ]
  35. Read in required packages
  36. :[font = input; preserveAspect; endGroup; ]
  37. <<Statistics`DescriptiveStatistics`
  38. <</hal/Zenda/ZendaDistn/StatPlots.m
  39. :[font = subsection; inactive; preserveAspect; startGroup; ]
  40. Read in data
  41. :[font = input; preserveAspect; endGroup; ]
  42. {pay,choice,card} = ReadData["/hal/Zenda/Data/July16/Raw/zendaB.data.spaces",8];
  43. :[font = subsection; inactive; preserveAspect; startGroup; ]
  44. Set parameters
  45. :[font = input; preserveAspect; endGroup; ]
  46. round1=15;
  47. round2=25;
  48. :[font = subsection; inactive; preserveAspect; startGroup; ]
  49. Execute this cell
  50. :[font = input; preserveAspect; endGroup; endGroup; ]
  51.    Print[StringForm["Phase 1 fraction of cooperation = ``",N[LocationReport[Take[Map[Mean,choice,1],round1]]]]]
  52.    Print[StringForm["Phase 1 card played = ``",N[LocationReport[Take[Map[Mean,card  ,1],round1]]]]] 
  53.    Print[StringForm["Phase 2 fraction of cooperation = ``",N[LocationReport[Take[Map[Mean,choice,1],-round2]]]]]
  54.    Print[StringForm["Phase 2 card played = ``",N[LocationReport[Take[Map[Mean,card  ,1],-round2]]]]]
  55.    Print[StringForm["Phase 2 card payment = ``",N[LocationReport[Take[Map[Mean,pay  ,1],-round2]]]]]
  56.    Print["Quartile plots of fraction cooperating plays, card played, payment"]
  57.    QuartilePlot[choice]
  58.    QuartilePlot[card]
  59.    QuartilePlot[pay]
  60.    Print["Range plots of fraction cooperating plays, card played, payment"]
  61.    RangePlot[choice]
  62.    RangePlot[card]
  63.    RangePlot[pay]
  64.  
  65.  
  66. ^*)